public class Player {
    int balance;
    String name;
    Poker poker;
    //下注的钱
    int betMoney = 0;
    int all_inMoney = 0;
    //状态：在线为TRUE，弃牌为FALSE
    boolean status = true;
    public Player(int balance, String name) {
        this.balance = balance;
        this.name = name;
    }

    public void addMoney(int money) {
        balance += money;
    }
    public boolean subMoney(int money) {
        if(balance>money){
            balance -= money;
            return true;
        }else
            return false;
    }


    //下注，成功返回真，失败返回假
    public boolean Bet(int money) {
        if (this.balance > money) {
            this.balance -= money;
            this.betMoney += money;
            return true;
        } else
            return false;
    }

    //弃牌
    public void discard(){
        this.status = false;
    }

    //比牌 原值大返回真，传入值大返回假
    public boolean compareCard(Player player){
        if(this.poker.compare(player.poker)){
            return true;
        }else
            return false;
    }
    //All-In 返回all in金额
    public int all_In(){
        all_inMoney = balance;
        balance = 0;
        return all_inMoney;
    }

    public void showMune(){
        System.out.println(this.name);
        System.out.println(this.balance);
        this.poker.display();
    }
}